import { configureStore } from '@reduxjs/toolkit' ;

import user from "./reducer/userReducer";
import role from "./reducer/roleReducer";
import path from "./reducer/pathReducer";
import menu from "./reducer/menuReducer";
import reimburse from "./reducer/reimburseReducer";
import reimburseDetail from "./reducer/reimburseDetailReducer";
import consume from "./reducer/consumeReducer";
import navigate from "./reducer/navigateReducer";
import part from "./reducer/partReducer";
import engineData from "./reducer/engineDataReducer";

export const store = configureStore({
    reducer: {
        user,
        role,
        path,
        menu,
        reimburse,
        reimburseDetail,
        navigate,
        consume ,
        part,
        engineData
    },
    // middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(logger).concat(thunk)
}) ;

// Infer the `RootState` and `AppDispatch` types form the store itself
export type RootState = ReturnType<typeof store.getState>
// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}
export type AppDispatch = typeof store.dispatch ;

export default store ;

